package com.pioneer.gui.invoice.view;

import com.pioneer.gui.invoice.model.InvoiceModel;




import java.awt.Component;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Vector;

import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.JPanel;
import javax.swing.JLabel;

import javax.swing.JTextField;
import javax.swing.JScrollPane;


import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableCellEditor;

import javax.swing.event.TableModelListener;
import javax.swing.event.TableModelEvent;

import javax.swing.event.TableModelEvent;

public class DetailsPanel
extends JPanel
implements TableModelListener
{	
	//private InvoiceModel model;
	public DetailsTable detailsTable;
	
	public DetailsPanel(InvoiceModel model)
	{	
		//this.model=panel.model;
		this.setLayout(new GridLayout(1,1));
		detailsTable=new DetailsTable(model);		
		JScrollPane scrollpane = new JScrollPane(detailsTable);
		this.add(scrollpane);
		detailsTable.getModel().addTableModelListener(this);		
	}
	
	public void tableChanged(TableModelEvent e)
	{	
	    this.detailsTable.revalidate();
	    this.detailsTable.repaint();
	}
	
	public int getSelectedRow()
	{
		return this.detailsTable.getSelectedRow();
	}
	
	
}